package com.github.wj.security.server.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "T_SYS_USER")
public class TSysUser implements Serializable {
    private Long id;
    private String userid;
    private String password;
    private String name;
    private String jurisdiction;

    @Id
    @Column(name = "ID")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "USERID")
    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    @Basic
    @Column(name = "PASSWORD")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "NAME")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "JURISDICTION")
    public String getJurisdiction() {
        return jurisdiction;
    }

    public void setJurisdiction(String jurisdiction) {
        this.jurisdiction = jurisdiction;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TSysUser tSysUser = (TSysUser) o;
        return Objects.equals(id, tSysUser.id) &&
                Objects.equals(userid, tSysUser.userid) &&
                Objects.equals(password, tSysUser.password) &&
                Objects.equals(name, tSysUser.name) &&
                Objects.equals(jurisdiction, tSysUser.jurisdiction);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, userid, password, name, jurisdiction);
    }
}
